package com.example.mobile2121606110syc0409homework;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private TextView tvMainTitle;
    private Button btnMainAdd;
    private Button btnMainMAX;
    private Button btnMainPassword;
    private Button btnMainWdzh;
    private Button btnMainMath;
    private Button btnMainScore;
    private Button btnMainNumber;
    private Button btnMainCount;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        btnMainAdd.setOnClickListener(this);
        btnMainMAX.setOnClickListener(this);
        btnMainPassword.setOnClickListener(this);
        btnMainWdzh.setOnClickListener(this);
        btnMainMath.setOnClickListener(this);
        btnMainScore.setOnClickListener(this);
        btnMainNumber.setOnClickListener(this);
        btnMainCount.setOnClickListener(this);
    }

    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tvMainTitle);
        btnMainAdd = (Button) findViewById(R.id.btnMainAdd);
        btnMainMAX = (Button) findViewById(R.id.btnMainMAX);
        btnMainPassword = (Button) findViewById(R.id.btnMainPassword);
        btnMainWdzh = (Button) findViewById(R.id.btnMainWdzh);
        btnMainMath = (Button) findViewById(R.id.btnMainMath);
        btnMainScore = (Button) findViewById(R.id.btnMainScore);
        btnMainNumber = (Button) findViewById(R.id.btnMainNumber);
        btnMainCount = (Button) findViewById(R.id.btnMainCount);
    }
    public void onClick(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.btnMainAdd:
                intent.setClass(MainActivity.this, MainActivity1.class);
                startActivity(intent);
                break;
            case R.id.btnMainMAX:
                intent.setClass(MainActivity.this, MainActivity2.class);
                startActivity(intent);
                break;
            case R.id.btnMainPassword:
                intent.setClass(MainActivity.this, MainActivity3.class);
                startActivity(intent);
                break;
            case R.id.btnMainWdzh:
                intent.setClass(MainActivity.this, MainActivity4.class);
                startActivity(intent);
                break;
            case R.id.btnMainMath:
                intent.setClass(MainActivity.this, MainActivity5.class);
                startActivity(intent);
                break;
            case R.id.btnMainScore:
                intent.setClass(MainActivity.this, MainActivity6.class);
                startActivity(intent);
                break;
            case R.id.btnMainNumber:
                intent.setClass(MainActivity.this, MainActivity7.class);
                startActivity(intent);
                break;
            case R.id.btnMainCount:
                intent.setClass(MainActivity.this, MainActivity8.class);
                startActivity(intent);
                break;
        }
    }
}
